package com.zxx.pattern.factoryPattern.factorySample;

import java.util.Scanner;

/**
 * @author zxx on 2020/12/28
 */
public class Test {

    private static BMW bmw;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请选择要生产的骑车型号：");
        System.out.println("1:BMW 523");
        System.out.println("1:BMW 320");
        int type = scanner.nextInt();

        bmw = FactoryBMW.createBMW(type);
        if (bmw != null) {
            bmw.introduce();
        } else {
            System.out.println("没有这个车型！");
        }
        scanner.close();
    }

}
